package com.warehouse.module.business.dal.mysql.productnametype;

import java.util.*;

import com.warehouse.framework.common.pojo.PageResult;
import com.warehouse.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.warehouse.framework.mybatis.core.mapper.BaseMapperX;
import com.warehouse.module.business.dal.dataobject.productnametype.ProductNameTypeDO;
import org.apache.ibatis.annotations.Mapper;
import com.warehouse.module.business.controller.admin.productnametype.vo.*;

/**
 * 品名/型号管理 Mapper
 *
 * @author Eric
 */
@Mapper
public interface ProductNameTypeMapper extends BaseMapperX<ProductNameTypeDO> {

    default PageResult<ProductNameTypeDO> selectPage(ProductNameTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProductNameTypeDO>()
                .likeIfPresent(ProductNameTypeDO::getName, reqVO.getName())
                .betweenIfPresent(ProductNameTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProductNameTypeDO::getId));
    }

}